package org.awa.demo.opencv.bean;

/**
 * @author xxf
 */
public class Rgb {

    public static Rgb ZERO = new Rgb(0,0,0);

    private double[] val = new double[3];

    public Rgb(double r,double g,double b){
        val[0] = b;
        val[1] = g;
        val[2] = r;
    }

    public double[] getVal(){
        return val;
    }

    public Rgb weight(int weight){
        val[0] = val[0] * weight;
        val[1] = val[1] * weight;
        val[2] = val[2] * weight;
        return this;
    }

}
